package com.binc.testspring.study.jdkObjservable;

import com.google.common.eventbus.EventBus;
import com.google.common.eventbus.Subscribe;

/**
 * Copyright (C), 2019-2021, XXX 奇限公司
 * FileName: GuavaEvent
 * Autho: binC
 * Date:  2021/11/23 18:56
 * Description:
 * History:
 * <author>     <time>      <version>       <desc>
 * 作者姓名       修改时间      版本          描述
 */
public class GuavaEvent {
    @Subscribe
    public void subscribe(String str){
        //业务逻辑
        System.out.println("执行subscribe方法,传入的参数是:" + str);
    }


    public static void main(String[] args) {
        EventBus eventbus = new EventBus();
        GuavaEvent guavaEvent = new GuavaEvent();
        eventbus.register(guavaEvent);
        eventbus.post("Tom");
    }


}